{% extends "base.html" %}

{% block content %}
<div class="container mt-4">
    <div class="row">
        <div class="col-md-8 offset-md-2">
            <div class="card">
                <div class="card-header">
                    <h3>个人中心</h3>
                </div>
                <div class="card-body">
                    <div class="row mb-3">
                        <div class="col-md-3 text-muted">账号：</div>
                        <div class="col-md-9">{{ current_user.username }}</div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-3 text-muted">姓名：</div>
                        <div class="col-md-9">{{ current_user.real_name or '未设置' }}</div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-3 text-muted">角色：</div>
                        <div class="col-md-9">
                            {% if current_user.role == 'admin' %}
                                管理员
                            {% elif current_user.role == 'teacher' %}
                                教师
                            {% else %}
                                学生
                            {% endif %}
                        </div>
                    </div>
                    {% if current_user.role == 'student' %}
                    <div class="row mb-3">
                        <div class="col-md-3 text-muted">班级：</div>
                        <div class="col-md-9">{{ current_user.class_name or '未设置' }}</div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-3 text-muted">学院：</div>
                        <div class="col-md-9">{{ current_user.academy_name or '未设置' }}</div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-3 text-muted">专业：</div>
                        <div class="col-md-9">{{ current_user.major_name or '未设置' }}</div>
                    </div>
                    {% endif %}
                    {% if current_user.role == 'teacher' %}
                    <div class="row mb-3">
                        <div class="col-md-3 text-muted">学院：</div>
                        <div class="col-md-9">{{ current_user.academy_name or '未设置' }}</div>
                    </div>
                    {% endif  %}
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}